import React, { Fragment } from 'react';
var defaultRenderItem = function defaultRenderItem(val) {
  return val !== undefined
    ? /*#__PURE__*/ React.createElement(
        'span',
        {
          className: 'szzj-form-detail-tag',
        },
        val,
      )
    : null;
};
var Tag = function Tag(props) {
  var valuePropName = props.valuePropName,
    _props$renderDetailIt = props.renderDetailItem,
    renderDetailItem = _props$renderDetailIt === void 0 ? defaultRenderItem : _props$renderDetailIt;
  var value = valuePropName ? props[valuePropName] : props.value;
  return /*#__PURE__*/ React.createElement(
    Fragment,
    null,
    Array.isArray(value)
      ? /*#__PURE__*/ React.createElement(
          'div',
          {
            className: 'szzj-form-detail-tags',
          },
          value.map(function (val, index) {
            return /*#__PURE__*/ React.createElement(
              'span',
              {
                key: index,
                className: 'szzj-form-detail-tag',
              },
              renderDetailItem(val),
            );
          }),
        )
      : renderDetailItem(value),
  );
};
export default Tag;
